package cn.hanyx.coder.design.pattern.structural.bridge.demo02;

import cn.hanyx.coder.design.pattern.structural.bridge.demo02.handler.AlertHandler;
import cn.hanyx.coder.design.pattern.structural.bridge.info.ApiStatInfo;

import java.util.ArrayList;
import java.util.List;

public class Alert02 {
    private List<AlertHandler> alertHandlers = new ArrayList<>();

    public void addAlertHandler(AlertHandler alertHandler) {
        this.alertHandlers.add(alertHandler);
    }

    public void check(ApiStatInfo apiStatInfo) {
        for (AlertHandler alertHandler : alertHandlers) {
            alertHandler.check(apiStatInfo);
        }
    }
}